package com.jiyun.model.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @TableName invitation
 */
@TableName(value ="invitation")
@Data
public class Invitation implements Serializable {
    @TableId(type = IdType.AUTO)
    private Integer invitationId;

    private Integer inviterUserId;

    private Integer invitedUserId;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date invitationTime;

    private String rewardStatus;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Invitation other = (Invitation) that;
        return (this.getInvitationId() == null ? other.getInvitationId() == null : this.getInvitationId().equals(other.getInvitationId()))
            && (this.getInviterUserId() == null ? other.getInviterUserId() == null : this.getInviterUserId().equals(other.getInviterUserId()))
            && (this.getInvitedUserId() == null ? other.getInvitedUserId() == null : this.getInvitedUserId().equals(other.getInvitedUserId()))
            && (this.getInvitationTime() == null ? other.getInvitationTime() == null : this.getInvitationTime().equals(other.getInvitationTime()))
            && (this.getRewardStatus() == null ? other.getRewardStatus() == null : this.getRewardStatus().equals(other.getRewardStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getInvitationId() == null) ? 0 : getInvitationId().hashCode());
        result = prime * result + ((getInviterUserId() == null) ? 0 : getInviterUserId().hashCode());
        result = prime * result + ((getInvitedUserId() == null) ? 0 : getInvitedUserId().hashCode());
        result = prime * result + ((getInvitationTime() == null) ? 0 : getInvitationTime().hashCode());
        result = prime * result + ((getRewardStatus() == null) ? 0 : getRewardStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", invitationId=").append(invitationId);
        sb.append(", inviterUserId=").append(inviterUserId);
        sb.append(", invitedUserId=").append(invitedUserId);
        sb.append(", invitationTime=").append(invitationTime);
        sb.append(", rewardStatus=").append(rewardStatus);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}